// stores/counter.js
import { defineStore } from 'pinia';
import { CounterState } from './types'
const useCounterStore = defineStore('counter', {
    // 状态
    state: ():CounterState => ({
        count: 1,
    }),
    // 可以同步或异步的 action
    actions: {
        increment() {
            this.count++;
        },
        decrement() {
            this.count--;
        },
    },
    persist: {
        key: 'countter'
    }
});

export default useCounterStore;
